<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('借款财务处理')" />
    <link rel="stylesheet" href="../../../../../../../../../../../../css/navigation.css">
</head>
<body class="gray-bg">
<div class="navigation visible-xs-block">
    <ol class="breadcrumb">
        <span> > </span>
        <li><a href="#" onclick="gomain()">主页</a></li>
        <li style="color: black">借款财务处理</li>
    </ol>
    <div class="aLine"></div>
</div>
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>借款类型：</label>
<!--                                <select name="bStatus">-->
<!--                                    <option value="">所有</option>-->
<!--                                </select>-->
                                <select id="bStatus" name="bStatus" th:with="type=${@dict.getType('borrowing_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}">
                                </select>
                            </li>
                            <li>
                                <label style="width: 100px">借款申请人：</label>
                                <input type="text" name="bApplicant"/>
                            </li>
                            <li class="select-time">
                                <label>借款时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBTime]"/>
                            </li>
                            <li>
                                <label>借款原因：</label>
                                <input type="text" name="bCause"/>
                            </li>
                            <li>
                                <label>借款金额：</label>
                                <input type="text" name="bAmount"/>
                            </li>
                            <li>
                                <label>余额：</label>
                                <input type="text" name="bBalance"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script src="../../../../../../../../../../../../js/breadcrumb.js"></script>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('ruoyi:amount:edit')}]];
        var removeFlag = [[${@permission.hasPermi('ruoyi:amount:remove')}]];
        var prefix = ctx + "ruoyi/amountFinancial";
        var bStatus = [[${@dict.getType('borrowing_status')}]];
        var bType = [[${@dict.getType('borrowing_type')}]];

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "借款财务处理列表",
                showColumns: false,
                columns: [
                {
                    field: 'bId', 
                    title: '借款id',
                    visible: false
                },
                {
                    field: 'bStatus', 
                    title: '借款类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(bStatus, value);
                    }
                },
                {
                    field: 'bApplicant', 
                    title: '借款申请人'
                },
                {
                    field: 'bTime',
                    title: '借款时间'
                },
                {
                    field: 'bCause', 
                    title: '借款原因'
                },
                {
                    field: 'bAmount', 
                    title: '借款金额'
                },
                {
                    field: 'bBalance', 
                    title: '余额'
                },
                {
                    field: 'bType',
                    title: '审批类型',
                    align: "center",
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(bType, value);
                    }
                },
                {
                    field: 'bOpinion',
                    title: '审批意见',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(bType, value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if (row.bType==2){
                            actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="consents(\'' + row.bId + '\')"><i class="fa fa-user"></i> 处理</a> ');
                        }
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        function consents(bId) {

            $.modal.confirm("确认要通过申请吗?", function() {
                var url = prefix + "/consents";
                var data = { "bId": bId };
                $.operate.submit(url, "post", "json", data);
            });
        }
    </script>
</body>
</html>